package com.seesman.application.maintenance.common.gui.utilities;

import static com.seesman.application.maintenance.common.constants.CertificateConstant.*;
import static com.seesman.application.maintenance.common.gui.utilities.MessageFormatUtil.format;

import java.util.EnumMap;
import java.util.Map;

public class FrameDetailsUtil {

	private static final String resourceBundle = "ApplicationResource";
	
	public enum VesselCertificateLabel {CERTIFICATE_ID, CERTIFICATE_NAME, CERTIFICATE_NO, 
		ISSUING_AUTHORITY, DATE_ISSUED, PLACE_ISSUED, VALIDITY, ANNUAL, INTERMEDIATE, EXPIRY_DATE, REMARKS}
	
	public enum CertificateLabel {CERTIFICATE_ID, CERTIFICATE_NAME, STATUS}
	
	public enum AboutBoxLabel {TITLE_LABEL, TITLE_DESC, VERSION_LABEL, VERSION_DESC, HOMEPAGE_LABEL, HOMEPAGE_DESC, IMAGE_LABEL}
	
	public Map<VesselCertificateLabel, String> getMapVesselCertificateLabel(){
		Map<VesselCertificateLabel, String> mapCertLabel = new EnumMap<VesselCertificateLabel, String>(VesselCertificateLabel.class);
		mapCertLabel.put(VesselCertificateLabel.CERTIFICATE_ID, CERTIFICATE_ID);
		mapCertLabel.put(VesselCertificateLabel.CERTIFICATE_NAME, CERTIFICATE_NAME);
		mapCertLabel.put(VesselCertificateLabel.CERTIFICATE_NO, CERTIFICATE_NO);
		mapCertLabel.put(VesselCertificateLabel.ISSUING_AUTHORITY, ISSUING_AUTHORITY);
		mapCertLabel.put(VesselCertificateLabel.DATE_ISSUED, DATE_ISSUED);
		mapCertLabel.put(VesselCertificateLabel.PLACE_ISSUED, PLACE_ISSUED);
		mapCertLabel.put(VesselCertificateLabel.VALIDITY, VALIDITY);
		mapCertLabel.put(VesselCertificateLabel.ANNUAL, ANNUAL);
		mapCertLabel.put(VesselCertificateLabel.INTERMEDIATE, INTERMEDIATE);
		mapCertLabel.put(VesselCertificateLabel.EXPIRY_DATE, EXPIRY_DATE);
		mapCertLabel.put(VesselCertificateLabel.REMARKS, REMARKS);
		
		return mapCertLabel;
	}
	
	public Map<CertificateLabel, String> getMapCertificateLabel(){
		Map<CertificateLabel, String> mapLabel = new EnumMap<CertificateLabel, String>(CertificateLabel.class);
		
		mapLabel.put(CertificateLabel.CERTIFICATE_ID, CERTIFICATE_ID);
		mapLabel.put(CertificateLabel.CERTIFICATE_NAME, CERTIFICATE_NAME);
		mapLabel.put(CertificateLabel.STATUS, STATUS);
		
		return mapLabel;
		
	}
	
	public Map<AboutBoxLabel, String> getMapAboutBox(){
		Map<AboutBoxLabel, String> map = new EnumMap<AboutBoxLabel, String>(AboutBoxLabel.class);
		
		map.put(AboutBoxLabel.TITLE_LABEL, format(resourceBundle, "label.Title"));
		map.put(AboutBoxLabel.TITLE_DESC, format(resourceBundle, "label.desc.Title"));
		map.put(AboutBoxLabel.VERSION_LABEL, format(resourceBundle, "label.Version"));
		map.put(AboutBoxLabel.VERSION_DESC, format(resourceBundle, "label.desc.Version"));
		map.put(AboutBoxLabel.HOMEPAGE_LABEL, format(resourceBundle, "label.HomePage"));
		map.put(AboutBoxLabel.HOMEPAGE_DESC, format(resourceBundle, "label.desc.HomePage"));
		map.put(AboutBoxLabel.IMAGE_LABEL, format(resourceBundle, "label.Image"));
		
		return map;
	}
	
}
